Better PIC code production: Using #pragma GCC visibility, *all*
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 13 Sep 2006 13:24:42 +0000 (14:24 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 13 Sep 2006 13:24:42 +0000 (14:24 +0100)
data references benefit, not just the ones to objects defined in the
same translation unit. However, as this now is a header file change,
detection logic cannot be used as nicely, so I guess we want to keep the
previous change and add this one on top.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/include/xen/compiler.h

index 2cf74900dc1427dd29bbc4c6bd2fc5ced20f96f3..d70833efb54cb037c68200dc20de9b6443e155e2 100644 (file)
 #define offsetof(a,b) ((unsigned long)&(((a *)0)->b))
 #endif
 
+#if defined(__x86_64__) && (__GNUC__ > 3)
+/* Results in more efficient PIC code (no indirections through GOT or PLT). */
+#pragma GCC visibility push(hidden)
+#endif
+
 /* This macro obfuscates arithmetic on a variable address so that gcc
    shouldn't recognize the original var, and make assumptions about it */
 /*